<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
<input type="text" placeholder="请输入猜的数">
<input type="button" value="猜一猜">
<h1>{{msg}}</h1>
</div>
<!--引入jq框架-->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    let x=parseInt(Math.random()*100)+1;

    let vm=new Vue({
        el:"div",
        data:{msg:""}
    })
    //给按钮添加点击事件
    $("input:last").click(function () {
        if($("input:first").val()>x){
            vm.msg="猜大了"
        }else if($("input:first").val()<x){
            vm.msg="猜小了"
        }else{
            vm.msg="猜对了"
        }
    })
</script>
</body>
</html>